<!doctype html>
<html>
@include('top.title')
<body>
<style>
    .text > p > img {
        width: 10%;
        height: 10%;
    }
</style>
@include('top.header')
@if(!empty(session('success')))
    <div id="tishi"
         style="background-color: #caeaca;position:absolute; margin:840px 2px 4px 1580px;width:300px;height: 24px;padding:10px;border-radius: 50px;">
        <span style="text-align: center;display:block;"> 提示信息：{{session('success')}}</span>
    </div>
@endif
<div class="mainContent">
    @include('top.menu')
    <form action="/" method="get">
        <input class="shuru2" name="content" placeholder="<?php if(!empty($search['content'])){echo $search['content'];}else{echo "请输入搜索内容";}?>" type="text" value="">
    </form>
    <div class="blogitem">
        @foreach($list as $k=>$v)
            <article>
                <h2><img style="width: 50px;height:50px;border-radius:25px;"
                         src="{{$v['url']}}" alt="">
                    <a style="color: #f16e50" href="/article/{{$v['article_id']}}">{{$v['title']}}</a></h2>
                <ul class="text">
                    @if(mb_strlen($v['content'],'utf-8')>300)
                        <?php echo strip_tags(mb_substr($v['content'], 0, 1500) . '......')?>
                    @else
                        <?php echo mb_substr($v['content'], 0, 1500) ?>
                    @endif
                </ul>
                <div class="textfoot">
                    <span style="color:#a6a6a6;">发表时间:{{$v['add_time']}}</span>
                    <a href="/article/{{$v['article_id']}}">阅读全文</a>
                </div>
            </article>
            <hr style="margin-bottom:5px ">
        @endforeach
    </div>
</div>
<div class="pages" style="text-align:center;margin:0 auto;width: 100%;margin-left:-60px">
    {{$list->links()}}
</div>
@include('top.footer')
</body>
</html>